<?php
/* how to...
$msgs=new Msg;
$arr=array(
		'to'=>'18123978848',
		'text'=>'美女, 在家么?',
	);
if($msgs->send($arr)) echo 'OK!';
else echo 'Failed';

服务公司: 三三得九 http://www.33e9.com/
套餐: php webservice
*/

class Msg
{
	public $account = '账号:admin'; // 账号密码需要购买
	public $passwd = '密码'; // 账号密码需要购买
	public $wsdl = 'http://ws.iems.net.cn/GeneralSMS/ws/SmsInterface?wsdl';
	
	function __construct(){}
	
	public function send($param){
		$arr=array(
			'username'=>$this->account,
			'password'=>$this->passwd,
			'presendTime'=>'',
			'to'=>$param['to'],
			'text'=>$param['text'].'',
			'isVoice'=>'',
			'from'=>'',
		);
		$client = new SoapClient($this->wsdl);
		//$result = $client->clusterSend($arr);
		$result = $client->clusterSend($arr['username'],$arr['password'],$arr['from'],$arr['to'],$arr['text'],$arr['presendTime'],$arr['isVoice']);
		//pre($result);
		$temp=x2a($result);
		//pre($temp);
		$tem=$temp['code'];
		if($tem=='1000') return true;
		return false;
	}
	public function getinfo(){
		$arr=array(
			'username'=>$this->account,
			'password'=>$this->passwd,
		);
		$client = new SoapClient($this->wsdl);
		$result = $client->getUserInfo($arr['username'],$arr['password']);
		pre($result);
		$temp=x2a($result);
		pre($temp);
		$tem=$temp['code'];
		if($tem=='1000') return true;
		return false;
	}
}

?>